-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Gmail - new components #18131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gmail - new components #18131
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds two new Gmail actions to list and retrieve Send-As aliases via the Gmail API, and bumps the Gmail component version to 1.3.0. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User/Workflow
participant A as Action: List Send-As
participant G as Gmail App
participant API as Gmail API
U->>A: Run action
A->>G: listSignatures({ $ })
G->>API: GET users.settings.sendAs.list
API-->>G: sendAs[]
G-->>A: { sendAs, ... }
A-->>U: Response (exports summary with count)
note over A,U: Summarizes number of aliases
sequenceDiagram
autonumber
participant U as User/Workflow
participant A as Action: Get Send-As
participant G as Gmail App
participant API as Gmail API
U->>A: Run with sendAsEmail
A->>G: _client().users.settings.sendAs.get({ userId, sendAsEmail })
G->>API: GET users/{userId}/settings/sendAs/{sendAsEmail}
API-->>G: alias data
G-->>A: { data }
A-->>U: Alias data (exports success summary)
note over A: Options for sendAsEmail populated via listSignatures()
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
components/gmail/package.json (1)
15-25: Optional: Update Gmail client & auth library versionsThe script check shows you’re currently on:
- @googleapis/gmail at ^13.0.1 (latest is 14.0.1)
- google-auth-library at ^8.7.0 (latest is 10.2.1)
No peerDependencies or compatibility issues were reported for the newest releases. To reduce the risk of auth regressions in future actions, consider:
- Bumping
"@googleapis/gmail"to^14.0.1- Bumping
"google-auth-library"to^10.2.1- Running your full test suite (and any integration tests) to verify nothing breaks
components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs (1)
13-20: Guard against undefined response and improve summary/return ergonomicsIf the API returns no sendAs field, the summary renders “undefined”. Also, returning the array directly is often more ergonomic for step outputs (callers can iterate without drilling into
response.sendAs). Not required, but improves DX.Apply:
async run({ $ }) { - const response = await this.gmail.listSignatures({ - $, - }); - - $.export("$summary", `Successfully retrieved ${response.sendAs?.length} send as aliases`); - - return response; + const response = await this.gmail.listSignatures({ $ }); + const items = response?.sendAs ?? []; + $.export("$summary", `Successfully retrieved ${items.length} send-as aliases`); + // Return the array for convenience; keep full response under meta if needed. + return items; },components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs (2)
22-31: Add friendly error handling and a more descriptive summarySurface 404 / not-found with context, and include the alias in the success summary.
Apply:
async run({ $ }) { - const { data } = await this.gmail._client().users.settings.sendAs.get({ - userId: constants.USER_ID, - sendAsEmail: this.sendAsEmail, - }); - - $.export("$summary", "Successfully retrieved send as alias"); - - return data; + try { + const { data } = await this.gmail._client().users.settings.sendAs.get({ + userId: constants.USER_ID, + sendAsEmail: this.sendAsEmail, + }); + $.export("$summary", `Successfully retrieved send-as alias: ${data?.sendAsEmail ?? this.sendAsEmail}`); + return data; + } catch (err) { + if (err?.code === 404) { + throw new Error(`Send-as alias not found: ${this.sendAsEmail}`); + } + throw err; + } },
4-21: Optional: consider reusing a propDefinition for sendAsEmailIf other actions will reference send-as aliases, centralizing the dynamic options as a propDefinition in gmail.app.mjs (e.g.,
propDefinitions.sendAsEmail) reduces duplication and keeps behavior consistent across actions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs(1 hunks)components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs(1 hunks)components/gmail/package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (3)
components/gmail/package.json (1)
3-3: Semver bump looks correct for new actionsAdding user-facing actions justifies a minor bump from 1.2.0 → 1.3.0. LGTM.
components/gmail/actions/list-send-as-aliases/list-send-as-aliases.mjs (1)
1-11: Action metadata is clear and consistentKey, name, description link, and props shape match existing conventions for Pipedream Gmail actions. Import path to gmail.app.mjs also looks correct.
components/gmail/actions/get-send-as-alias/get-send-as-alias.mjs (1)
1-3: USER_ID and OAuth Scope Verification CompleteI have confirmed that:
constants.USER_IDis defined as"me"incomponents/gmail/common/constants.mjsand is consistently used across all Gmail actions (e.g.,listMessages,getMessage,listSignatures, and the newget-send-as-aliasaction).- The Gmail OAuth scopes include
https://www.googleapis.com/auth/gmail.settings.basicin the_serviceAccountAuthmethod ofcomponents/gmail/gmail.app.mjs(lines 522–524), and the README setup instructions also list this scope.No further changes are required.
jcortes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927 lgtm! Ready for QA!
Resolves #18070
Summary by CodeRabbit
New Features
Chores